package org.salatec.tapestry4e.internal.contenttype;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;

import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.ITextContentDescriber;
import org.eclipse.wst.html.core.internal.contenttype.ContentDescriberForHTML;
import org.eclipse.wst.sse.core.internal.encoding.IContentDescriptionExtended;

public final class ContentDescriberForTML implements ITextContentDescriber {

	private static ContentDescriberForHTML describer = new ContentDescriberForHTML();

	final private static QualifiedName[] SUPPORTED_OPTIONS = {
			IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK,
			IContentDescriptionExtended.DETECTED_CHARSET,
			IContentDescriptionExtended.UNSUPPORTED_CHARSET,
			IContentDescriptionExtended.APPROPRIATE_DEFAULT };

	public int describe(Reader contents, IContentDescription description)
			throws IOException {

		return describer.describe(contents, description);
	}

	public int describe(InputStream contents, IContentDescription description)
			throws IOException {

		return describer.describe(contents, description);
	}

	public QualifiedName[] getSupportedOptions() {
		return SUPPORTED_OPTIONS;
	}

}
